/* eslint-disable no-unused-vars */
import api from '@/api/index.js'
import { post, get, From, postJson } from '@/api/request'//真实请求
const state = {
    searchList: [],
}

const mutations = {
    GETSEARCHLIST(state, data) {
        state.searchList = data
    }
}

const actions = {
    getSearchList({ commit }, data) {
        return new Promise((resolve, reject) => {
            postJson(api.searchList, data).then(res => {
                if (res.code == 200) {
                    commit('GETSEARCHLIST', res.data)
                    resolve(res.data)
                }
            }).catch(err => {
                reject(err)
            });
        })
    }
}

export default {
    state,
    mutations,
    actions
}
